import request from '@/utils/request'

// 查询devices列表
export function listDevices(query) {
  return request({
    url: '/iot/devices/list',
    method: 'get',
    params: query
  })
}

// 查询devices详细
export function getDevices(deviceId) {
  return request({
    url: '/iot/devices/' + deviceId,
    method: 'get'
  })
}
export function reset(clientId) {
  return request({
    url: '/iot/devices/reset/' + clientId,
    method: 'get'
  })
}
// 新增devices
export function addDevices(data) {
  return request({
    url: '/iot/devices',
    method: 'post',
    data: data
  })
}

// 修改devices
export function updateDevices(data) {
  return request({
    url: '/iot/devices',
    method: 'put',
    data: data
  })
}

// 删除devices
export function delDevices(deviceId) {
  return request({
    url: '/iot/devices/' + deviceId,
    method: 'delete'
  })
}

export function sendMsg(deviceId,data) {
  return request({
    url: '/iot/devices/send/' + deviceId,
    data:data,
    method: 'post'
  })
}
